package top.qingyunge.autumn.util;

import java.util.Map;

public class ThreadLocalUtil {
    // 提供ThreadLocal 对象
    private static final ThreadLocal<Map<String,Object>> THREAD_LOCAL = new ThreadLocal<>();

    // 获取存储值
    public static Map<String,Object> get() {
        return THREAD_LOCAL.get();
    }

    // 存储值
    public static void set(Map<String,Object> value) {
        THREAD_LOCAL.set(value);
    }

    // 清除THREAD_LOCAL 防止内存泄漏
    public static void remove() {
        THREAD_LOCAL.remove();
    }
}